import React, { Component } from 'react'
import { connect } from 'react-redux'
import { View, Button, Text} from '@tarojs/components'
import Map from '../../commit/Map'
import { add, minus, asyncAdd } from '../../actions/counter'

import './index.scss'


@connect(({ counter }) => ({
  counter
}), (dispatch) => ({
  add () {
    dispatch(add())
  },
  dec () {
    dispatch(minus())
  },
  asyncAdd () {
    dispatch(asyncAdd())
  },
  goToAdd(){
    wx.navigateTo({ url: '/pages/sign/add/index' });
  }
}))
class Index extends Component {
  componentWillReceiveProps (nextProps) {
    console.log(this.props, nextProps)
  }

  componentWillUnmount () {
   
}

  componentDidShow () { 
    
  }

  componentDidHide () { }
  
  render () {
    
    return (
      <View className='index'>
        <Map/>
        <View className='indBtn'>
        <Button className='btn' onClick={this.props.goToAdd}>添加面试</Button>
        </View>
        
      </View>
    )
  }
}

export default Index

